package cc.yugu.yhdw.webserver.service.basic;

import cc.yugu.yhdw.common.domain.basic.PlatformInOutMoney;
import cc.yugu.yhdw.common.entity.pagination.Page;
import cc.yugu.yhdw.webserver.persistence.basic.PlatformInOutMoneyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 新添加类：总部流水业务
 *
 * @Date:Created in 2018/9/3 16:29
 * @Author:
 * @Modified By: zjn 2018/9/3 16:29
 */
@Service
public class PlatformInOutMoneyService {

    @Autowired
    PlatformInOutMoneyMapper platformInOutMoneyMapper;
    /**
    * 分页查询
    *
    * @Param: [search]
    * @Return: cc.yugu.yhdw.common.entity.pagination.Page
    * @Author By: zjn 2018/7/5  16:07
    */
    public Page findPage(PlatformInOutMoney search) {
        Page page = search.buildPage();
        page.setTotalItems(platformInOutMoneyMapper.findPageCount(search));
        search.setBeginIndex(page.getOffset());
        page.setResult(platformInOutMoneyMapper.findPageResult(search));

        return page;
    }
    
    /**
    * 根据收入类型查询
    * 
    * @Param: [bizType]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.basic.PlatformInOutMoney>
    * @Author By: zjn 2018/9/3  16:28
    */ 
    public List<PlatformInOutMoney> find(Integer bizType){
        return platformInOutMoneyMapper.find(bizType);
    }

}
